package com.alibaba.manager;

import com.alibaba.common.SystemConstants;
import com.alibaba.define.domain.ArticleDO;
import com.alibaba.define.domain.LinkDO;
import com.alibaba.mapper.LinkMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

import static com.alibaba.enums.LinkStatusEnum.APPROVED;

/**
 * @author : hanyang
 * @date : 2023-11-02 23:48
 **/

@Component
public class LinkManager {

    @Resource
    LinkMapper linkDAO;

    /**
     * 查询所有审核通过的Link
     */
    public List<LinkDO> getAllPassLink() {
        HashMap<String, Object> parameterHashMap = new HashMap<>();
        parameterHashMap.put("status", APPROVED.getCode());
        parameterHashMap.put("delFlag", SystemConstants.UN_DELETED);
        return linkDAO.select(parameterHashMap);
    }
}
